import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
      state:{
            city:'重庆'
      },
      actions:{
            changeCity(a,name){

                  a.commit('changeCity',name)

            }
      },
      mutations:{
            changeCity(state,name){

                  console.log('mutations')
                  console.log(state)
                  console.log(name)

                  state.city = name

            }

      }
})